package com.sanbi.common.express.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @description: 出库委托类型
 * @author: wanpeng
 * @create: 2024-05-29 08:45
 * @Version 1.0
 **/
@AllArgsConstructor
@Getter
public enum CaiNiaoConsignmentTypeEnum {

    S("S" , "标准出库"),
    D("D" , "下架销毁"),
    R("R" , "退仓出库"),
    DS("DS" , "dropshipping出库"),
    P("P" , "FBA Pro"),
    O("O", "其他出库");

    /** 编码 */
    private final String code;
    /** 描述 */
    private final String desc;

    public static CaiNiaoConsignmentTypeEnum getByCode(String code) {
        for (CaiNiaoConsignmentTypeEnum e : CaiNiaoConsignmentTypeEnum.values()) {
            if (Objects.equals(e.getCode(), code)) {
                return e;
            }
        }
        return CaiNiaoConsignmentTypeEnum.O;
    }
}
